home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / CREATE A MULTI-USER CONFIGURATION.INFO < prev    next >
Encoding:
Text File  |  2002-02-05  |  2.6 KB  |  70 lines

  1. How to create a multi-user configuration (Pro versions only)
  2.  
  3. There are three options. The first option is to add the following section 
  4. to the Ide\master.ini file:
  5.  
  6. [Workspace]
  7. DataPath=CSIDL_APPDATA
  8.  
  9. This will put each users configuration data in <Documents and Settings>\
  10. <user name>\Application Data\<IDE name>.
  11.  
  12. The master.ini file must be located in the Ide folder.
  13.  
  14. The second option to activate a multiuser configuration is to 
  15. create an onLogon.script and put it in Tools/EventHandlers/Startup. 
  16. This will result in a Logon dialog being shown during startup to 
  17. allow you to set a unique Data folder path for each user. You can 
  18. use the sample script shown below as a starting point for your onLogon
  19. script.
  20.  
  21. A third option is to run the createUserContext script in Tools/Application.
  22. This will create a create an application context that has its own data folder. 
  23. This script creates a new shortcut that will start the IDE using the specified data
  24. folder. Each context will have its own state including window list, last project, 
  25. toolbar states, findParameters, and so on. This script uses the /inifile command 
  26. line option.
  27.  
  28. Copyright ⌐ 2000-2002 - Modelworks Software
  29.   
  30. /**
  31. @Event: onLogon~processes the results from the logon dialog. The
  32. logon dialog is only activated if this script is named onLogon.script
  33. and is located in Tools/EventHandlers/Startup. This script can be used 
  34. by when multiple users will be using the same installation, such as in
  35. network installations, so that each user can have their own 
  36. configuration. The sample implementation shown below saves user 
  37. configuration in the Users folder in the servers IDE folder. Return true
  38. to continue and false to exit. 
  39. @EndTool:
  40. @Summary: onLogon~processes the results from the logon dialog
  41. */
  42.  
  43. // Store the UserDatabase in the default Data folder
  44. var gUserDatabaseMapPath = File.getApplicationPath() + "\\Ide\\Data\\UserDatabase.map";
  45. var gUserDatabaseMapMapFile = getMapFile(gUserDatabaseMapPath);
  46.  
  47. var gRootDirectory = File.getApplicationPath() + "\\Users\\";
  48.  
  49. // The gUserDatabaseMapMapFile should be loaded by another script
  50. gUserDatabaseMapMapFile.add("admin", Application.hash("admin"));
  51. gUserDatabaseMapMapFile.add("test", Application.hash("test"));
  52.  
  53. function OnEvent(name, password)
  54. {
  55.     if (gUserDatabaseMapMapFile.lookup(name) == Application.hash(password))
  56.     {
  57.         if (name == "admin")
  58.         {
  59.             return true; // use default Data folder located in Ide/Data
  60.         }
  61.         else
  62.         {
  63.             Application.dataPath = gRootDirectory + name;
  64.             return true; // use the new dataPath
  65.         }
  66.     }
  67.     return false; // Do not continue
  68. }
  69.  
  70.